// Fill out your copyright notice in the Description page of Project Settings.

#include "WorldSignal.h"
#include "WorldEntityReferencing.h"

WORLD_ENTITY_META_DEFINE(FWorldSignal, FWorldEntity);

FWorldSignal::FWorldSignal()
	: Super()
	, S(this, 0.0)
	, T(this, 0.0)
	, Name(this, "")
	, Dynamic(this, "no")
	, Orientation(this, FWorldRoadObjectOrientation::None)
	, ZOffset(this, 0.0)
	, Country(this, "")
	, Type(this, "-1")
	, Subtype(this, "-1")
	, Value(this, 0.0)
	, Unit(this, "")
	, Height(this, 0.0)
	, Width(this, 0.0)
	, Text(this, "")
	, HOffset(this, 0.0)
	, Pitch(this, 0.0)
	, Roll(this, 0.0)
	, Validity(this)
	, Dependency(this)
{}

FWorldSignal::FWorldSignal(const json& j)
	: Super(j)
	, S(this, 0.0, _xml, "s")
	, T(this, 0.0, _xml, "t")
	, Name(this, "", _xml, "name")
	, Dynamic(this, "no", _xml, "dynamic")
	, Orientation(this, FWorldRoadObjectOrientation::None, _xml, "orientation")
	, ZOffset(this, 0.0, _xml, "zOffset")
	, Country(this, "", _xml, "country")
	, Type(this, "-1", _xml, "type")
	, Subtype(this, "-1", _xml, "subtype")
	, Value(this, 0.0, _xml, "value")
	, Unit(this, "", _xml, "unit")
	, Height(this, 0.0, _xml, "height")
	, Width(this, 0.0, _xml, "width")
	, Text(this, "", _xml, "text")
	, HOffset(this, 0.0, _xml, "hOffset")
	, Pitch(this, 0.0, _xml, "pitch")
	, Roll(this, 0.0, _xml, "roll")
	, Validity(this, _xml, "validity")
	, Dependency(this, _xml, "dependency")
{}

FWorldSignal::~FWorldSignal()
{}

void FWorldSignal::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(Validity)
		.Resolve(Dependency);
}
